<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
    <meta charset="UTF-8"/>
    <#assign base=request.contextPath  />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>充电桩后台管理系统</title>
    <link rel="stylesheet" type="text/css" href="${base}/css/login/normalize.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/css/login/demo.css"/>
    <link rel="stylesheet" type="text/css" href="${base}/css/cloud.css"/>
    <link rel="stylesheet" href="${base}/frame/layui/css/layui.css">
    <script type="text/javascript" src="${base}/frame/layui/layui.js"></script>
    <!--必要样式-->
    <link rel="stylesheet" type="text/css" href="${base}/css/login/component.css"/>
    <script src="${base}/js/html5.js"></script>
    <script src="${base}/js/jquery.min.js"></script>
    <script src="${base}/js/jquery.blockUI.js"></script>
    <script src="${base}/js/cloud.js"></script>
</head>
<style>
.footer{
    position: fixed;
    bottom: 10px;
    margin-left: 60px;
}
</style>
<body>
<script>
    //控制跳出ifream框架
    if (window != top)
        top.location.href = location.href;
</script>

<div class="container demo-1">
    <div class="content">
        <div id="large-header" class="large-header">
            <canvas id="demo-canvas"></canvas>
            <div class="logo_box">
                <h3>充电桩后台管理系统 欢迎你</h3>
                <div class="input_outer">
                    <span class="u_user"></span>
                    <input id="account"   class="text" style="color: #FFFFFF !important" type="text"  >
                </div>
                <div class="input_outer">
                    <span class="us_uer"></span>
                    <input id="password" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;" type="password">
                </div>

                <div class="mb2"><a onclick="login()" id="login" class="act-but submit" href="javascript:;" style="color: #FFFFFF"
                                    data-loading="正在验证登录，请稍后...">登录</a></div>
                <#--<div style="width:300px;margin:0 auto; padding:20px 0;">-->
                <#--<div style="position: fixed;bottom: 10px;border: 1px solid red;margin-left: 10px;">-->
                    <#--<a target="_blank" href=" " class="footer" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">-->
                        <#--<img src="${base}/images/jing.png" style="float:left;"/><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">鄂公网安备 42011102003487号</p ></ a>-->
                <#--</div>-->
            <#--</div>-->
            <#--<span target="_blank" href=" " class="footer" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;">-->
            <#--<img src="${base}/images/jing.png" style="float:left;"/>-->
                <#--<p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">鄂公网安备 42011102003487号</p >-->
            <#--</span>-->
        </div>

    </div>

</div><!-- /container -->

<script src="${base}/js/TweenLite.min.js"></script>
<script src="${base}/js/EasePack.min.js"></script>
<script src="${base}/js/rAF.js"></script>
<script src="${base}/js/demo-1.js"></script>
    <script>
        if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0)
        {

            var _interval = window.setInterval(function () {
                var autofills = $('input:-webkit-autofill');
                if (autofills.length > 0) {
                    window.clearInterval(_interval); // 停止轮询
                    autofills.each(function() {
                        var clone = $(this).clone(true, true);
                        $(this).after(clone).remove();
                    });
                }
            }, 20);
        }

        function login() {


            if ($("#account").val() == "" || $("#account").val() == null) {
                layer.msg("请正确输入账户", {icon: 5})
                return;
            }
            if ($("#password").val() == "" || $("#password").val() == null) {
                layer.msg("请正确输入密码", {icon: 5})
                return;
            }

            $.modal.loading("请稍后...");
            setTimeout(function () {
                $.ajax({
                    type: "POST",
                    url: "${base}/admin/userInfo/login",
                    async: false,
                    data: {
                        "account": $("#account").val(),
                        "password": $("#password").val()
                    },
                    success: function (data) {
                        if (data.code === 200) {
                            window.location.href = "${base}/admin/userInfo/index.html"
                        } else {
                            layer.msg(data.msg, {icon: 5})
                        }
                        $.modal.closeLoading();
                    },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {
                        $.modal.closeLoading();
                    }
                });
            }, 500)

        }

        //键盘事件
        $("body").bind("keydown",function(e){
            // 兼容FF和IE和Opera
            var theEvent = e || window.event;
            var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
            if (code == 13) {
                //回车执行查询
                $("#login").click();
            }
        });


    </script>
</body>
</html>